IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].GetDeliverableStatusesForProgress') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].GetDeliverableStatusesForProgress 
GO
-- =======================================================================
-- Procedure Name: dbo.GetDeliverableStatusesForProgress
--
-- Author:      Kevin Cashman, Parallax Consulting LLC
--
-- Create date: 03/12/09
--
-- Description: Returns list of Deliverable Statuses for Subcontract Reports
--
-- Parameters:  None
--              
-- Returns:     INT, 0=Success, -1=Error
--
-- SampleCall:
-- EXECUTE dbo.GetDeliverableStatusesForProgress()
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 03/12/09    RM		 Created based on the GetDeliverableTypes stored
--
-- =======================================================================

CREATE PROCEDURE [dbo].[GetDeliverableStatusesForProgress]
AS
BEGIN
     /*  Returned Fields for Dropdown
     --------------------------------
     DELSTAT             VARCHAR             
     DELSTATID           VARCHAR
     */

     -- Initial Settings
     SET NOCOUNT ON
     
     -- Declare Local Variables
     DECLARE   @Error            INT,
               @RowCount         INT

     -- Result Query    
     SELECT 'ALL'   AS DELSTAT,
               0    AS DELSTATID,
            'All' AS DELSTATDESC
     UNION     
     SELECT 'Progress Report-Pending Out Years',
               1,
            'Progress Report-Pending Out Years'
     UNION
     SELECT 'Progress Report-Awaiting Dept Paperwork',
               2,
            'Progress Report-Awaiting Dept Paperwork'
     UNION
     SELECT 'Progress Report-Complete',
               3,
            'Progress Report-Complete'
     ORDER BY DELSTATID              

     SELECT @Error=@@ERROR,@RowCount=@@ROWCOUNT
     IF @Error!=0
          RETURN -1

     -- Return Success
     RETURN 0
     
END
GO

GRANT EXECUTE ON dbo.GetDeliverableStatusesForProgress TO InsightReport,Insight
GO

